FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }}
{% block labels %}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% endblock %}

{% block watcher_base_header %}{% endblock %}

{% import "macros.j2" as macros with context %}

{{ macros.configure_user(name='watcher') }}

ADD watcher-base-archive /watcher-base-source

{% set watcher_base_pip_packages = [
    '/watcher'
] %}

COPY extend_start.sh /usr/local/bin/kolla_extend_start

RUN ln -s watcher-base-source/* watcher \
    && {{ macros.install_pip(watcher_base_pip_packages | customizable("pip_packages")) }} \
    && mkdir -p /etc/watcher \
    && cp -r /watcher/etc/watcher/* /etc/watcher/ \
    && touch /usr/local/bin/kolla_watcher_extend_start \
    && chmod 644 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_watcher_extend_start

{{ macros.kolla_patch_sources() }}

{% block watcher_base_footer %}{% endblock %}
